<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*,java.io.*,java.sql.*,InvestmentPojo.*;"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>FDI Tool</title>
<link rel="icon" type="image664/png" href="images664/dev7logo.png" />
<link href="images664/style.css" rel="stylesheet" type="text/css"
	media="screen" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<script type="text/javascript" src="images664/jquery-1.3.2.min.js"></script>
<% 
/* Properties props = new Properties(System.getProperties());
FileInputStream fis=new FileInputStream("D:/New_Fema_Project/WebContent/WEB-INF/classes/ApplicationResources.properties");
props.setProperty("a", "test");
props.store(new FileOutputStream("ApplicationResources.properties"), null);
props.load(fis);  
//System.out.println("============================="+props.getProperty("key.inverstor1")+"Samba Test"+"test");
 */
//Map bundle = new HashMap();
List optionsList123=new ArrayList();
//bundle = props;
Connection con=null;
//Map map=new HashMap();
String optionvalue="";
try{
	Class.forName("org.gjt.mm.mysql.Driver");
	con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","test");
	Statement st=con.createStatement();
	
	ResultSet rs=st.executeQuery("select * from investment_in_india where form_id = 1 order by option_label");
	
	while(rs.next()){
		OptionsList obj = new OptionsList();
		
		
		obj.setOptionId(rs.getString(1));
		obj.setListTypeId(rs.getString(2));
		obj.setOptionLabel(rs.getString(3));
		obj.setOptionValue(rs.getString(4));
		obj.setQestFlag(rs.getString(7));
		obj.setShowFlag(rs.getString(8));
		optionsList123.add(obj);
		//System.out.println("==========================="+obj);
		
		
	}
//	System.out.println(optionsList);	
}catch(Exception e ){
	e.printStackTrace();
	con.close();
	
}
%>

<script language='javascript' type='text/javascript'>
function loadSectorDropDown()
{
	var selectedValue ='';
	var selectedInvestor ='';
	var radios ='';
	
	radios = document.getElementsByName("entity");		
	for(var i = 0; i < radios.length; i++) {
	    if(radios[i].checked) selectedValue = radios[i].value;  
	} 	
	radios = document.getElementsByName("investor");
	for(var i = 0; i < radios.length; i++) {
	    if(radios[i].checked) selectedInvestor = radios[i].value;  
	}
	//alert("selected value..."+selectedValue);
	var xmlhttp;
	if (window.XMLHttpRequest)
	  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
	   xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
		// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     {
		  document.getElementById("TR04").innerHTML = "";
	     document.getElementById("TR04").innerHTML= xmlhttp.responseText;
 	    }
	  }
	xmlhttp.open("GET","dropDownAction.do?key="+selectedValue+"&invkey="+selectedInvestor+"&formId="+1,true);
	xmlhttp.send();
	selectedValue = '';
}
function loadFormToSubmit()
{

	var selectedValue ='';
	var sectorId = '';
	var subsectorId = '';
	var invRadiosValue = getSelectedRadiosValue("investor");
	    if(invRadiosValue != "" && null != invRadiosValue){ 
	    	selectedValue = invRadiosValue;  
	}	//alert(selectedValue+"--1");
	var entityRadios = getSelectedRadiosValue("entity");		
	    if(entityRadios != "" && null != entityRadios){ 
	    	selectedValue = selectedValue+'.'+entityRadios;  
	} 	///alert(selectedValue+"--2");
	sectorId = document.getElementById("sectorid");
		if(sectorId.value != "")		
		selectedValue = selectedValue+'.'+sectorId.value; 
	//alert(selectedValue+"--3");
    subsectorId= document.getElementById("subsectorid");
    	if(subsectorId.value != ""){
    	selectedValue = selectedValue+'.'+subsectorId.value;
    }//alert(selectedValue+"--4");
    var repatValue = getSelectedRadiosValue("repat");
		if(repatValue != "" && null != repatValue){
		selectedValue = selectedValue+'.'+repatValue;
	}
	var modeOfInvValue = getSelectedRadiosValue("modeofinvest");
	 	if(modeOfInvValue !="" && null != modeOfInvValue){
		selectedValue = selectedValue+'.'+modeOfInvValue;
	 }  //alert(selectedValue+"--5");
	var msmedValue = getSelectedRadiosValue("msmed");
		if(msmedValue != "" && null != msmedValue){
			selectedValue = selectedValue+'.'+msmedValue;
		}
	var notMsmedValue = getSelectedRadiosValue("notmsmed");
		if(notMsmedValue != "" && null != notMsmedValue){
			selectedValue = selectedValue+'.'+notMsmedValue;
		}
	//alert("selected value = "+selectedValue);
	document.getElementById("selected").innerHTML = "Selected Key - "+selectedValue;
	var xmlhttp;
	if (window.XMLHttpRequest)
	  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
	   xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
		// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     {
		document.getElementById("myDiv").innerHTML='';
		cache: false;
	    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
	    cache: false;
	    }
	  }
	xmlhttp.open("GET","investorAction.do?key="+selectedValue+"&formId="+1,true);
	xmlhttp.send();
	selectedValue = '';
}
function radioUncheckFun(radiosname){
	var radList = document.getElementsByName(radiosname);
	if(null != radList){
	 for (var i = 0; i < radList.length; i++) {
	 if(radList[i].checked) radList[i].checked = false;
	 }
}}
function getSelectedRadiosValue(NameofRadios){
	var selectedRadioValue='';
	var radList = document.getElementsByName(NameofRadios);
	if(null != radList){
	 for (var i = 0; i < radList.length; i++) {
	 if(radList[i].checked) selectedRadioValue = radList[i].value;
	 }
	 return selectedRadioValue;
   }
}
function goForConclution(){
	loadFormToSubmit();
	document.getElementById("Answers").style.display="";
	document.getElementById("selected").style.display="";
	document.getElementById("myDiv").innerHTML="<img alt='Plz wait...' src='loading9.gif' width='30'/>&nbsp;&nbsp;<p valign='top'>Plz wait...while loading...</p>";
	document.getElementById('bottom').scrollIntoView();
}
function onClickMSMED(){
	 radioUncheckFun("notmsmed");
	 document.getElementById("selected").style.display="none";
	 var yesbutton = document.getElementById("tr8yes");
	 var nobutton = document.getElementById("tr8no");
	 if(yesbutton.checked){
		 //document.getElementById("table6").style.display="";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("table7").style.display="none";
		}
	
	 if(nobutton.checked){
		 document.getElementById("submitbutton").style.display="none";
		 document.getElementById("table6").style.display="none";
		 document.getElementById("table7").style.display="";
		 document.getElementById("Answers").style.display="none";
	 }
	 
}
function onClickNotMSMED(){
	document.getElementById("selected").style.display="none";
	 var yesbutton=document.getElementById("yesnmsmed");
	 var nobutton=document.getElementById("nonmsmed");
	 if(yesbutton.checked){
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		}
	 if(nobutton.checked){
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("submitbutton").style.display="";
	 }
}
function onChangeInvestor(id){
	document.getElementById("selected").style.display="none";
	var id1= document.getElementById(id);
	radioUncheckFun("modeofinvest");
	radioUncheckFun("repat");
	 var arr=new Array();
     arr=id.split("~");     
     if(arr[1] == "N"){
        // alert("buf...");
    	 document.getElementById("submitbutton").style.display="";
     }
		switch (id1.value)
	{    
	case '1':
		 setVisibilityArr([document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("litag6"),document.getElementById("table1"),document.getElementById("table2"),document.getElementById("table3"),document.getElementById("table4"),document.getElementById("table6")],"none");
		 document.getElementById("quest").style.display=""; document.getElementById("sectorid").selectedIndex='';
		 radioUncheckFun("entity"); radioUncheckFun("msmed"); radioUncheckFun("notmsmed"); radioUncheckFun("repat"); radioUncheckFun("modeofinvest");
		 break;
	case '2':
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("litag6"),document.getElementById("table2"),document.getElementById("Answers")],"none");
		 setVisibilityArr([document.getElementById("table1"),document.getElementById("quest")],""); document.getElementById("sectorid").selectedIndex='';
		 break;
	case '3':
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag4"),document.getElementById("litag6"),document.getElementById("Answers")],"none");
		 setVisibilityArr([document.getElementById("quest"),document.getElementById("table1")],""); document.getElementById("sectorid").selectedIndex='';
		 break;
	case '4':
		 setVisibilityArr([document.getElementById("table1"),document.getElementById("quest")],""); document.getElementById("sectorid").selectedIndex='';
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag6"),document.getElementById("Answers")],"none");
		 break;
	case '6':
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("Answers")],"none");
		 setVisibilityArr([document.getElementById("table1"),document.getElementById("quest")],""); document.getElementById("sectorid").selectedIndex='';
		 break;
	default:
		setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("litag6")],"");
	    setVisibilityArr([document.getElementById("quest"),document.getElementById("table1"),document.getElementById("table2"),document.getElementById("table3"),document.getElementById("table4"),document.getElementById("table5"),document.getElementById("table6"),document.getElementById("table7"),document.getElementById("table8"),document.getElementById("Answers"),document.getElementById("submitbutton")],"none");
		radioUncheckFun("investor"); radioUncheckFun("entity"); onChangeEntity('quest1'); radioUncheckFun("repat");
		document.getElementById("sectorid").selectedIndex=''; document.getElementById("subsectorid").selectedIndex='';
	}	
}
function onChangeEntity(id){
	document.getElementById("selected").style.display="none";
	var id1= document.getElementById(id);
		switch (id1.value)
	{    
	case '8':
		 document.getElementById("entity9").style.display="none";
		 document.getElementById("entity10").style.display="none";
		 document.getElementById("entity11").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';	
		 loadSectorDropDown();
		 break;
	case '9':
		 //alert(id1.value+"++++++++");1
         document.getElementById("entity8").style.display="none";
		 document.getElementById("entity10").style.display="none";
		 document.getElementById("entity11").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';
		 loadSectorDropDown();
		 break;
	case '10':
		// alert(id1.value+"++++++++");
         document.getElementById("entity8").style.display="none";
		 document.getElementById("entity9").style.display="none";
		 document.getElementById("entity11").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';
		 loadSectorDropDown();
		 break;
	case '11':
		 //alert(id1.value+"++++++++");
         document.getElementById("entity8").style.display="none";
		 document.getElementById("entity9").style.display="none";
		 document.getElementById("entity10").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';
		 loadSectorDropDown();
		 break;
	default:
		//alert('samba');
        document.getElementById("entity8").style.display="";
        document.getElementById("entity9").style.display="";
		document.getElementById("entity10").style.display="";
		document.getElementById("entity11").style.display="";
		//document.getElementById("entity12").style.display="";
		//document.getElementById("entity13").style.display="";
		document.getElementById("table2").style.display="none";
        document.getElementById("table3").style.display="none";
        document.getElementById("table4").style.display="none";
        document.getElementById("table5").style.display="none";
        document.getElementById("table6").style.display="none";
        document.getElementById("table7").style.display="none";
        document.getElementById("table8").style.display="none";
		document.getElementById("quest1").style.display="none";
		document.getElementById("Answers").style.display="none";
		document.getElementById("submitbutton").style.display="none";
		document.getElementById("sectorid").selectedIndex='';
		radioUncheckFun("entity");	
	}	
}

function onInvModeChange(id){
	document.getElementById("selected").style.display="none";
	document.getElementById("Answers").style.display="none";
	var id1= document.getElementById(id);	
    	 document.getElementById("submitbutton").style.display="none";
    	 document.getElementById("table5").style.display="none";
    	 
     switch (id1.value)
	{   
	case '78':
		 //alert(id1.value+"++++++++");
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '79':
		 //alert(id1.value+"++++++++");1
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '80':
		// alert(id1.value+"++++++++");
          document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 
		 break;
	case '81':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '82':
		 //alert(id.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '83':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '84':
		 //alert(id1.value+"++++++++");
        document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '85':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '86':
		 //alert(id1.value+"++++++++");
        document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '104':
		 //alert(id1.value+"++++++++");
       document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '105':
		 //alert(id1.value+"++++++++");
       document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '106':
		 //alert(id1.value+"++++++++");
       document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '107':
		 //alert(id1.value+"++++++++");
       document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode86").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	default:
		//alert('samba');
		 document.getElementById("invmode81").style.display="";
		 document.getElementById("invmode82").style.display="";
		 document.getElementById("invmode83").style.display="";
		 document.getElementById("invmode84").style.display="";
		 document.getElementById("invmode85").style.display="";
		 document.getElementById("invmode78").style.display="";
		 document.getElementById("invmode79").style.display="";
		 document.getElementById("invmode80").style.display="";
		 document.getElementById("invmode104").style.display="";
		 document.getElementById("invmode105").style.display="";
		 document.getElementById("invmode106").style.display="";
		 document.getElementById("invmode107").style.display="";
         document.getElementById("table5").style.display="none";
         document.getElementById("table6").style.display="none";
         document.getElementById("table7").style.display="none";
		 document.getElementById("quest2").style.display="none";
		 document.getElementById("submitbutton").style.display="none";
		 radioUncheckFun("modeofinvest");	
		 radioUncheckFun("msmed");
		 radioUncheckFun("notmsmed");
     }
		//alert(id1.value+"--answer");
}

function onSectorChange(){
	document.getElementById("selected").style.display="none";
	var x=document.getElementById("sectorid").selectedIndex;
	var sectoroptionvalue=document.getElementById("sectorid").options;
	var subsectorid = document.getElementById("subsectorid");
	radioUncheckFun("modeofinvest");
	radioUncheckFun("repat"); onInvModeChange('quest2');
	 document.getElementById("table5").style.display="none";
	 document.getElementById("table7").style.display="none";
	 document.getElementById("Answers").style.display="none";
	//subsectorid.innerHTML = xmlhttp.responseText;
	if(sectoroptionvalue != null && "" != sectoroptionvalue){
		switch(sectoroptionvalue[x].value){
		case '17':
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML +="<option value=''>Select One</option>";
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("13")){
				%>
				subsectorid.innerHTML +="<option name='<%=obj.getOptionId()%>' id='<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>' value='<%=obj.getOptionValue()%>' title='<%=obj.getOptionValue()%>'><%=obj.getOptionLabel()%></option>";
				<%	
				}
				}	  		
			} %>
			    break;
		case '18':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("14")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '19':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("15")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '25':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("16")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '28':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("17")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '30':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("18")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '31':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("19")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '38':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("20")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '45':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("22")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '47':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("21")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		default :
		        var radios=0;
		        var selectedValue=0;
		        radioUncheckFun("modeofinvest");
		        radioUncheckFun("msmed"); 
		   	 radioUncheckFun("notmsmed"); radioUncheckFun("repat");
		        selectedValue = getSelectedRadiosValue("entity");		
				document.getElementById("subsectorid").selectedIndex='';
				document.getElementById("table3").style.display="none";
				document.getElementById("submitbutton").style.display="none";
				document.getElementById("Answers").style.display="none";
				if("3" == getSelectedRadiosValue("investor")){//FIPB Approval
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}
					 /* document.getElementById("table4").style.display="none";
			    	 document.getElementById("submitbutton").style.display=""; */
				}else if("4" == getSelectedRadiosValue("investor")){//NRI FDI plicy
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						var nriAutomaticArr = new Array("15","20","24","36","43","44");
						var nriProhibitedArr = new Array("14","16","21","23","26","27","29","33","34","37","46");
						var nriGovernmentArr = new Array("22","97","32","35","40","39","41","42");
						var autoAndGov="52";
						var automaticsector = document.getElementById("sectorid");
						document.getElementById("table8").style.display="none";
						document.getElementById("table4").style.display="none";
						if(automaticsector != null && automaticsector != ""){
						for (var i = 0; i < nriAutomaticArr.length; i++){
							if(nriAutomaticArr[i] == automaticsector.value){
							 document.getElementById("table8").style.display="";								
							}
							  } 
						for (var i = 0; i < nriProhibitedArr.length; i++){
							if(nriProhibitedArr[i] == automaticsector.value){
								document.getElementById("submitbutton").style.display="";								
							}
							  } 
						for (var i = 0; i < nriGovernmentArr.length; i++){
							if(nriGovernmentArr[i] == automaticsector.value){
								document.getElementById("table8").style.display=""
								//document.getElementById("submitbutton").style.display="";								
							}
							  } 
						}if (autoAndGov == automaticsector.value){
							document.getElementById("table8").style.display="";
						}
						
					}
				}else if("2" == getSelectedRadiosValue("investor")){//3rd option FDI plicy
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						if("8" == getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("submitbutton").style.display="";
						}else if("10" != getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("table8").style.display="";
						}else if("10" == getSelectedRadiosValue("entity")){
							var othAutomaticArr = new Array("15","20","24","36","43","44");
							var othProhibitedArr = new Array("14","16","21","23","26","27","29","33","34","37");
							var othGovernmentArr = new Array("22","97","32","35","40","39","41","42","46");
							var autoAndGovArr = new Array("52","49","53","57","36","73");
							var automaticsector = document.getElementById("sectorid");
							document.getElementById("table8").style.display="none";
							document.getElementById("table4").style.display="none";
							if(automaticsector != null && automaticsector != ""){
							for (var i = 0; i < othAutomaticArr.length; i++){
								if(othAutomaticArr[i] == automaticsector.value){
								 document.getElementById("table4").style.display="";								
								}
								  } 
							for (var i = 0; i < othProhibitedArr.length; i++){
								if(othProhibitedArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < othGovernmentArr.length; i++){
								if(othGovernmentArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < autoAndGovArr.length; i++){
								if(autoAndGovArr[i] == automaticsector.value){
									document.getElementById("table4").style.display="";								
								}
								  }
							}
						}
					}
				}else if("6" == getSelectedRadiosValue("investor")){//OCB's
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						if("8" == getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("submitbutton").style.display="";
						}else if("10" != getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("table8").style.display="";
						}else if("10" == getSelectedRadiosValue("entity")){
							var othAutomaticArr = new Array("15","20","24","43","44");
							var othProhibitedArr = new Array("14","16","21","23","26","27","29","33","34","37","46");
							var othGovernmentArr = new Array("22","97","32","35","40","39","41","42","46");
							var autoAndGovArr = new Array("52","49","53","57","36","73");
							var automaticsector = document.getElementById("sectorid");
							document.getElementById("table8").style.display="none";
							document.getElementById("table4").style.display="none";
							if(automaticsector != null && automaticsector != ""){
							for (var i = 0; i < othAutomaticArr.length; i++){
								if(othAutomaticArr[i] == automaticsector.value){
								 document.getElementById("table4").style.display="";								
								}
								  } 
							for (var i = 0; i < othProhibitedArr.length; i++){
								if(othProhibitedArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < othGovernmentArr.length; i++){
								if(othGovernmentArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < autoAndGovArr.length; i++){
								if(autoAndGovArr[i] == automaticsector.value){
									document.getElementById("table4").style.display="";								
								}
								  } 
							}
						}
					}
				}
				else{
			    	 document.getElementById("table4").style.display="";
			     }
			     //onInvModeChange('quest2');
		}
		
}}
 function onSubSectorChange(){
	 document.getElementById("selected").style.display="none";
	 radioUncheckFun("modeofinvest");
	 radioUncheckFun("msmed");
	 radioUncheckFun("notmsmed"); radioUncheckFun("repat");
	 onInvModeChange('quest2');  document.getElementById("submitbutton").style.display="none";
	 document.getElementById("Answers").style.display="none";
	 if("3" == getSelectedRadiosValue("investor")){//FIPB Approval
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}
			 /* document.getElementById("table4").style.display="none";
	    	 document.getElementById("submitbutton").style.display=""; */
	}else if("4" == getSelectedRadiosValue("investor")){//NRI FDI plicy
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				var nriAutomaticArr = new Array("48","49","50","51","53","54","57","60","61","63","69","70","80","73","76");
				var nriGovernmentArr = new Array("55","56","58","59","62","64","65","66","67","68","71","72","74","75","77");
				var automaticsector = document.getElementById("subsectorid");
				var autoAndGov="52";
				document.getElementById("table8").style.display="none";
				document.getElementById("table4").style.display="none";
				if(automaticsector != null && automaticsector != ""){
				for (var i = 0; i < nriAutomaticArr.length; i++){
					if(nriAutomaticArr[i] == automaticsector.value){
					 document.getElementById("submitbutton").style.display="none";
					 document.getElementById("table8").style.display="";								
					}
					  } 
				for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector.value){
						document.getElementById("table8").style.display=""
						//document.getElementById("submitbutton").style.display="";								
					}
					  } 
				}if (autoAndGov == automaticsector.value){
					document.getElementById("table8").style.display="";
				}
				
			}
	}else if("2" == getSelectedRadiosValue("investor")){//3rd option FDI plicy
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				var othAutomaticArr = new Array("48","50","51","54","60","61","63","69","80","76","70");
				var othGovernmentArr = new Array("55","56","58","59","62","64","65","66","67","68","71","72","74","75","77");
				var automaticsector = document.getElementById("subsectorid");
				var autoAndGov = new Array("52","49","53","57","36","73");
				document.getElementById("table8").style.display="none";
				document.getElementById("table4").style.display="none";
				if(automaticsector != null && automaticsector != ""){
				for (var i = 0; i < othAutomaticArr.length; i++){
					if(othAutomaticArr[i] == automaticsector.value){
					 document.getElementById("submitbutton").style.display="none";
					 document.getElementById("table4").style.display="";								
					}
					  } 
				for (var i = 0; i < othGovernmentArr.length; i++){
					if(othGovernmentArr[i] == automaticsector.value){
						document.getElementById("submitbutton").style.display="";								
					}
					  } 
				for (var i = 0; i < autoAndGov.length; i++){
					if(autoAndGov[i] == automaticsector.value){
						document.getElementById("table4").style.display="";								
				}
				  }
			    }
				}
	}else if("6" == getSelectedRadiosValue("investor")){ //OCB's
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				var othAutomaticArr = new Array("48","50","51","54","60","61","63","69","80","76","70");
				var othGovernmentArr = new Array("46","55","56","58","59","62","64","65","66","67","68","71","72","74","75","77");
				var automaticsector = document.getElementById("subsectorid");
				var autoAndGov=new Array("52","49","53","57","36","73");
				document.getElementById("table8").style.display="none";
				document.getElementById("table4").style.display="none";
				if(automaticsector != null && automaticsector != ""){
				for (var i = 0; i < othAutomaticArr.length; i++){
					if(othAutomaticArr[i] == automaticsector.value){
					 document.getElementById("submitbutton").style.display="none";
					 document.getElementById("table4").style.display="";								
					}
					  } 
				for (var i = 0; i < autoAndGov.length; i++){
					if(autoAndGov[i] == automaticsector.value){
						document.getElementById("table4").style.display="";								
					}
					  } 
				for (var i = 0; i < othGovernmentArr.length; i++){
					if(othGovernmentArr[i] == automaticsector.value){
						document.getElementById("submitbutton").style.display="";								
					}}
					  } 
			}
    }
}
function onClickRepatriation(){
	document.getElementById("selected").style.display="none";
	var repyes=document.getElementById("repyes");
	 var repno=document.getElementById("repno");
	 var sectorId=document.getElementById("sectorid");
	 onInvModeChange('quest2'); radioUncheckFun("modeofinvest"); radioUncheckFun("msmed"); radioUncheckFun("notmsmed");
	 //alert(sectorId.value);
	 if(repyes.checked){
		 if("4" == getSelectedRadiosValue("investor")){
			 document.getElementById("submitbutton").style.display="";
		 }
			 
	     if(sectorId.value >= 89){
	    	 document.getElementById("Answers").style.display="none";
	    	 document.getElementById("submitbutton").style.display="";
	    	 document.getElementById("table4").style.display="none";
	     }else{
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("table5").style.display="none";
		 document.getElementById("table7").style.display="none";
		 document.getElementById("submitbutton").style.display="none";
		 document.getElementById("table4").style.display="";
		}
	     if("4" == getSelectedRadiosValue("investor")){
			 var nriGovernmentArr = new Array("22","97","32","35","40","39","41","42","55","56","58","59","62","64","65","66","67","68","71","72","74","75","77");
			 var automaticsector = document.getElementById("sectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
			 var automaticsector1 = document.getElementById("subsectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector1.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
		 }		
	     }
	 if(repno.checked){
		 if(sectorId.value >= 89){
	    	 radioUncheckFun("modeofinvest");
	    	 document.getElementById("Answers").style.display="none";
	    	 document.getElementById("table5").style.display="none";
	    	 document.getElementById("table7").style.display="none";
	    	 document.getElementById("submitbutton").style.display="";
	    	 document.getElementById("table4").style.display="none";
	     }else{
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("table5").style.display="none";
    	 document.getElementById("table7").style.display="none";
    	 document.getElementById("submitbutton").style.display="";
		 document.getElementById("table4").style.display="none";
		}
		 if("4" == getSelectedRadiosValue("investor")){
			 var nriGovernmentArr = new Array("22","97","32","35","40","39","41","42","55","56","58","59","62","64","65","66","67","68","71","72","74","75");
			 var automaticsector = document.getElementById("sectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
			 var automaticsector1 = document.getElementById("subsectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector1.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
		 }		 
	 }
}
function goForSectorConditions(){
	var sectorid=document.getElementById('sectorid');
	var SectorInfo='SectorInfo';
	 wLeft = window.screenLeft ? window.screenLeft : window.screenX;
     wTop = window.screenTop ? window.screenTop : window.screenY;
	 w=600;  h=200;
    var left = wLeft + (window.innerWidth / 2) - (w / 2);
    var top = wTop + (window.innerHeight / 2) - (h / 2);
    var settings='toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left;
    if(null != sectorid)
    var URL="dropDownAction.do?sectorvalue="+sectorid.value+"&method="+SectorInfo;
	myWind=window.open(URL,'',settings);
	//myWind.document.write("Test Success...!"+sectorid.value);
	myWind.focus();
}
function goForGuidelines(){
	 wLeft = window.screenLeft ? window.screenLeft : window.screenX;
     wTop = window.screenTop ? window.screenTop : window.screenY;
	 w=600; h=300;
    var left = wLeft + (window.innerWidth / 2) - (w / 2);
    var top = wTop + (window.innerHeight / 2) - (h / 2);
    var settings='toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left;
	myWind=window.open('','',settings);
	myWind.document.write("Guidelines Test Success...!");
	myWind.focus();
	
}
</script>
<body bgcolor="">
	<form name="frm" method="post">
		<table width="930" align="center" border="0" cellspacing="0"
			cellpadding="0" valign="middle">
			<input type="hidden" name="formId" value="1" />
			<tr>
				<td>&nbsp;</td>
			</tr>
		</table>
		<table width="930" align="center" class="TB" border="0"
			cellspacing="0" cellpadding="0" valign="middle">

			<tr>
				<td align="center" height="10" class="TITLE">FDI Tool</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td width="930">
					<table width="900" align="center" class="TDBBLR" border="0"
						cellspacing="0" cellpadding="0" valign="middle">
						<tr>
							<td class="test" width="900" id="" callspan="0"><b>Type
									Of Investor</b> &nbsp;<a style="display: none;" id="quest"
								href="javascript:onChangeInvestor('quest')" value="show all"
								align="right">show all</a></td>
						</tr>
						<% if(optionsList123 != null){
	for(int i=0;i<optionsList123.size();i++){
	OptionsList obj =(OptionsList)optionsList123.get(i); 
	if(obj.getListTypeId() != null && obj.getListTypeId().equals("10") && obj.getShowFlag().equals("Y")){
	%>
						<tr id="litag<%=obj.getOptionValue()%>">
							<td><font><b><label
										for="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"><input
											type="radio" name="investor"
											id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"
											value="<%= obj.getOptionValue()%>"
											onclick="onChangeInvestor('<%=obj.getOptionId() %>~<%=obj.getQestFlag() %>')" />&nbsp;&nbsp;&nbsp;<%= obj.getOptionLabel()%></label></b></font></td>
						</tr>
						<%	
	}
	}	  		
} %>
					</table>
					<div id="table1">
						<table width="900" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>

						<table width="900" align="center" class="TDBBLR" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr>
								<td class="test" width="900" align="left"><b>Type Of
										Entity In India</b> &nbsp;<a style="display: none;" id="quest1"
									href="javascript:onChangeEntity('quest1')" value="show all"
									align="right">show all</a></td>
							</tr>
							<% if(optionsList123 != null){
	for(int i=0;i<optionsList123.size();i++){
	OptionsList obj =(OptionsList)optionsList123.get(i); 
	if(obj.getListTypeId() != null && obj.getListTypeId().equals("11") && obj.getShowFlag().equals("Y")){
	%>
							<tr id="entity<%=obj.getOptionValue()%>">
								<td><font><b><label for="<%=obj.getOptionId()%>"><input
												type="radio" name="entity" id="<%=obj.getOptionId()%>"
												value="<%=obj.getOptionValue()%>"
												onclick="onChangeEntity('<%=obj.getOptionId() %>')" />&nbsp;&nbsp;&nbsp;<%= obj.getOptionLabel()%></label></b></font></td>
							</tr>
							<%	
	}
	}	  		
} %>

						</table>
					</div>
					<div id="table2">
						<table width="800" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="900" align="center" class="TDBBLR" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr id="TR01" class="test">
								<td width="700" id=""><b>Type
										Of Sector</b></td>
								<td width="300" align="right" id=""><a style="width:120px;text-align:right;padding-right:10px;background-color: green;" id="" value="" href="javascript:goForSectorConditions()">Sector Conditions</a></td>
							</tr>
							<tr id="TR04">
								<td colspan="2"><select
									style="width: 700px; border-radius: 5px;" name="qest2"
									onChange="onSectorChange()" id="sectorid">
								</select></td>
							</tr>
						</table>
					</div>
					<div id="table3">
						<table width="800" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="900" align="center" class="TDBBLR" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr>
								<td class="test" width="900"><font><b>Type Of
											Sub Sector</b></font></td>
							</tr>
							<tr id="TR06">
								<td colspan="2"><select
									style="width: 700px; border-radius: 5px;" name="qest3"
									onChange="onSubSectorChange()" id="subsectorid">&nbsp;
								</select></td>
							</tr>
						</table>
					</div>
					<div id="table8">
						<table width="900" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="910" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr class="test">
								<td width="200" colspan="2"><b>Whether The Investee Is
										&nbsp;</b></td>
								<td width="700" colspan="2"><b><label for="repyes"><input
											type="radio" value="Y" name="repat" id="repyes"
											onClick="onClickRepatriation()"><span
											class="seperator"
											onMouseover="ddrivetip('Sale proceeds and dividend net of taxes is eligible to be taken back from India.', 300)"
											;
onMouseout="hideddrivetip()">Repatriation ?</span>&nbsp;&nbsp;</label><label
										for="repno"><input type="radio" value="N" name="repat"
											id="repno" onClick="onClickRepatriation()"><span
											class="seperator"
											onMouseover="ddrivetip(' Sale proceeds and dividend net of taxes is <b>not eligible</b> to be taken back from India.', 300)"
											;
onMouseout="hideddrivetip()">Non Repatriation ?</span></b></td>
							</tr>
						</table>
					</div>
					<div id="table4">
						<table width="900" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="900" align="center" class="TDBBLR" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr>
								<td class="test" width="900" id=""><b>Mode Of
										Investment</b> &nbsp;<a style="display: none;" id="quest2"
									href="javascript:onInvModeChange('quest2')" value="show all"
									align="right">show all</a></td>
							</tr>
							<% if(optionsList123 != null){
	for(int i=0;i<optionsList123.size();i++){
	OptionsList obj =(OptionsList)optionsList123.get(i); 
	if(obj.getListTypeId() != null && obj.getListTypeId().equals("23")){
	%>
							<tr id="invmode<%=obj.getOptionValue()%>">
								<td title="<%=obj.getOptionValue()%>"><font><b><label
											for="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"><input
												type="radio" name="modeofinvest"
												id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"
												value="<%=obj.getOptionValue()%>"
												onclick="onInvModeChange('<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>')" />&nbsp;&nbsp;&nbsp;<%= obj.getOptionLabel()%></label></b></font></td>
							</tr>
							<%	
	}
	}	  		
} %>
						</table>
					</div>
					<table width="900" align="center" border="0" cellspacing="0"
						cellpadding="0" valign="middle">
						<tr>
							<td id="myDiv1"></td>
						</tr>
					</table>
					<div id="table5">
						<table width="900" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="910" align="center" class="TDBBLRT" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr class="test">
								<td width="70%"><b>Whether the Investee Indian Company
										is Micro, Small and Medium Enterprise in terms of Micro, Small
										and Medium Enterprises Development (MSMED) Act, 2006 .</b></td>
								<td width="30%"><b><label for="tr8yes">Yes&nbsp;<input
											type="radio" value="Y" name="msmed" id="tr8yes"
											onClick="onClickMSMED()"></label>&nbsp;&nbsp;<label
										for="tr8no">No&nbsp;<input type="radio" value="N"
											name="msmed" id="tr8no" onClick="onClickMSMED()"></label></b></td>
							</tr>
						</table>
					</div>
					<div id="table6">
						<table width="900" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="900" align="center" class="TDBBLRT" border="0"
							cellspacing="0" cellpadding="0" valign="middle" id="test1">
							<tr>
								<td><font><b>If yes, Please select the type of
											industry .</b></font></td>
							</tr>
							<tr>
								<td><select style="width: 700px; border-radius: 5px;"
									name="toi" onChange="onChange3()" id="optionvalue3"><option
											vlaue="Select One" default>Select One</option>

								</select>
								<td align="right"><input type="text" name="other"
									style="border-radius: 5px;" /></td>
								</td>
							</tr>
						</table>
					</div>
					<div id="table7">
						<table width="900" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="910" align="center" class="TDBBLRT" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr class="test">
								<td width="70%"><b>If not MSMED, please confirm whether
										it is an industrial undertaking having an industrial license
										under the provisions of The Industries (Development &
										Regulation) Act, 1951 for items reserved for MSE Sector .</b>
								<td width="30%"><b><label for="yesnmsmed">Yes&nbsp;<input
											type="radio" value="Y" name="notmsmed" id="yesnmsmed"
											onClick="onClickNotMSMED()"></label>&nbsp;&nbsp;<label
										for="nonmsmed">No&nbsp;<input type="radio" value="N"
											name="notmsmed" id="nonmsmed" onClick="onClickNotMSMED()"></label></b></td>
								</td>
							</tr>
						</table>
					</div>
					<div id="submitbutton" style="display: none;">
						<table width="900" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td align="center"><a align="center" id="finalanswer"
									href="javascript:goForConclution()" value="">Go For
										Conclusion</a></td>
							</tr>
							<tr>
								<td id="selected" style="display: none;"></td>
							</tr>
						</table>
					</div>
					<div id='bottom'>
						<div id="Answers" style="display: none;">
							<table width="800" align="center" border="0" cellspacing="0"
								cellpadding="0" valign="middle">
								<tr>
									<td>&nbsp;</td>
								</tr>
							</table>

							<table width="900" bgcolor="#E5E4E2" align="center"
								class="TDBBLRT" border="0" cellspacing="0" cellpadding="0"
								valign="middle">
								<tr>
									<td class="test" width="900" callspan="1" align="left"><b>Know
											Your Eligibility</b></td>
								</tr>
								<tr>
									<td id="myDiv" align="center">
										<table width="900" align="center" border="0" cellspacing="0"
											cellpadding="0" valign="middle">
										</table>
									</td>
								</tr>
							</table>
							<table width="800" align="center" border="0" cellspacing="0"
								cellpadding="0" valign="middle">
								<tr>
									<td>&nbsp;</td>
								</tr>
							</table>
							<table width="900" align="center" border="0" cellspacing="0"
								cellpadding="0" valign="middle">
								<tr>
									<td><a style="width:130px;text-align:center;background-color: green;" id="finalanswer"
									href="javascript:goForGuidelines()" value="">General
										Guidelines</a></td>
								</tr>
							</table>
						</div>
					</div>
			<tr>
				<td>&nbsp;</td>
			</tr>
			</td>
			</tr>
		</table>
		<table width="900" align="center" border="0" cellspacing="0"
			cellpadding="0" valign="middle">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
		</table>

	</form>
</body>
<script type="text/javascript">
function setVisibilityArr(varArray,visibility){
    if(null != varArray){
        for(i = 0; i < varArray.length; i++){
            var tdvar = varArray[i];
            if(tdvar != null){
            tdvar.style.display=visibility;
            }
        }
    }
 }
document.body.onload = function(){
    document.getElementById("sectorid").selected='';
    document.getElementById("table1").style.display="none";
    document.getElementById("table2").style.display="none";
    document.getElementById("table3").style.display="none";
    document.getElementById("table4").style.display="none";
    document.getElementById("table5").style.display="none";
    document.getElementById("table6").style.display="none";
    document.getElementById("table7").style.display="none";
    document.getElementById("table8").style.display="none";
     radioUncheckFun("entity");	
	 radioUncheckFun("investor");
	 radioUncheckFun("modeofinvest");	
	 radioUncheckFun("msmed");
	 }

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip
</script>
</html>